class Parent {
  constructor(name, age) {
    this.name = name
    this.age = age
  }

  say() {
    console.log('hello');

  }
}

class Child extends Parent {
  constructor(sex, name, age) {
    super(name, age)
    this.sex = sex
  }
}

const c = new Child('男', '张三', 18)
console.log(c);   // Child { name: '张三', age: 18, sex: '男' }
c.say()    // hello

